package org.apache.commons.httpclient.methods.multipart;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class FilePartSource
  implements PartSource
{
  private File file;
  private String fileName;

  public FilePartSource(File paramFile)
    throws FileNotFoundException
  {
    this.file = null;
    this.fileName = null;
    this.file = paramFile;
    if (paramFile == null)
      return;
    if (!(paramFile.isFile()))
      throw new FileNotFoundException("File is not a normal file.");
    if (!(paramFile.canRead()))
      throw new FileNotFoundException("File is not readable.");
    this.fileName = paramFile.getName();
  }

  public FilePartSource(String paramString, File paramFile)
    throws FileNotFoundException
  {
    this(paramFile);
    if (paramString == null)
      return;
    this.fileName = paramString;
  }

  public InputStream createInputStream()
    throws IOException
  {
    if (this.file != null);
    for (Object localObject = new FileInputStream(this.file); ; localObject = new ByteArrayInputStream(new byte[0]))
      return localObject;
  }

  public String getFileName()
  {
    if (this.fileName == null);
    for (String str = "noname"; ; str = this.fileName)
      return str;
  }

  public long getLength()
  {
    long l;
    if (this.file != null)
      l = this.file.length();
    while (true)
    {
      return l;
      l = 0L;
    }
  }
}

/* Location:           E:\Desktop\Android\wordstd\classes_dex2jar.jar
 * Qualified Name:     org.apache.commons.httpclient.methods.multipart.FilePartSource
 * JD-Core Version:    0.5.3
 */